/*
 * @Descripttion: 
 * @version: 
 * @Author: LiuXuFei
 * @Date: 2021-12-09 09:45:09
 * @LastEditors: linZeJian
 * @LastEditTime: 2022-11-02 14:16:42
 */
import request from "@/util/request/index.js"
import {
	filebaseUrl,
	idaasUrl,
	bmoUrl,
	baseUrl,
} from "@/util/config/config.js"
export default {
	// idaas相关接口
	//刷新
	async refresh(data) {
		let res = await request.GET({
			// 小程序url地址得写全
			url: "/idaas/api/refresh",
			baseURL: idaasUrl,
		})
		return res
	},
	// 手机号授权
	async getphone(data) {
		let res = await request.POST({
			url: "/idaas/app/auth",
			data: data,
			baseURL: idaasUrl,
		})
		return res
	},
	// 获取用户信息
	async getUsermsg() {
		let res = await request.GET({
			url: "/idaas/api/me",
			baseURL: idaasUrl,
		})
		return res
	},
	// 注册
	async getRegister(data) {
		let res = await request.POST({
			url: "/idaas/app/register",
			data: data,
			baseURL: idaasUrl,
		})
		return res
	},



	// bmo相关接口
	//获取数据模型数据
	async getFormTableDbData(tableId, obj) {
		let res = await request.POST({
			url: `/bmo/api/v1/form/table/db/data/${tableId}`,
			data: obj,
			baseURL: bmoUrl,
		})
		return res
	},


	// filebase相关接口
	// 上传文件
	async uploadFiles(obj) {
		let name = new Date().getTime();
		let res = await request.POST({
			header: {
				"content-type": "multipart/form-data"
			},
			baseURL: filebaseUrl,
			url: `/filebase/api/v1/app/formfile/${name}`,
			data: obj,
		});
		return res;
	},

	// idaas相关接口
	//获取当前登录
	async getLoginUserInfo() {
		let res = await request.GET({
			url: "/idaas/api/me",
			baseURL: idaasUrl,
		})
		return res
	},

}